const Koa = require('koa')
const Router = require('@koa/router')
const imgRoutes = require('./src/img')
const mpRoutes = require('./src/mp')
const resRoutes = require('./src/res')
const sRoutes = require('./src/s')
const videoRoutes = require('./src/video')

const app = new Koa()
const router = new Router()

app.use(imgRoutes).use(mpRoutes).use(resRoutes).use(sRoutes).use(videoRoutes).use(
  router.allowedMethods({
    throw: true
  })
)

const APP_PORT = 20001
app.listen(APP_PORT, '0.0.0.0', () => {
  console.log(`Server running on port ${APP_PORT}`)
})
